package edu.jetwinner.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xulixin
 */
public class FastHashMap {

    public static FastHashMap build() {
        return new FastHashMap();
    }

    public static FastHashMap build(int size) {
        return new FastHashMap(size);
    }

    private FastHashMap() {
        this.map = new HashMap<>();
    }

    private FastHashMap(int size) {
        this.map = new HashMap<>(size);
    }

    private final Map<String, Object> map;

    public FastHashMap add(String key, Object value) {
        this.map.put(key, value);
        return this;
    }

    public Map<String, Object> toMap() {
        return this.map;
    }

}